package StructuralPattern.AdapterPattern.ClassAdapterPattern;


import StructuralPattern.AdapterPattern.ClassAdapterPattern.adapter.MediaPlayer;

// 类适配器
public class MediaAdapter extends Mp4Player implements MediaPlayer {
    @Override
    public void play(String audioType, String fileName) {
        if (audioType.equalsIgnoreCase("mp4")) {
            playMp4(fileName);
        } else if (audioType.equalsIgnoreCase("vlc")) {
            // 创建 VLC 播放器实例
            new VlcPlayer().playVlc(fileName);
        }
    }
}